package com.bw.ivideo.testmvi.home.model.repository

import com.bw.ivideo.testmvi.home.model.api.HomeApi
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.flow.flow
import kotlinx.coroutines.flow.flowOn
import javax.inject.Inject

/**
 * @author ytx
 * @date 2025-10-16 10:08
 * @description
 */
class HomeRepository @Inject constructor(private val homeApi:HomeApi) {

    fun getSimpleType() = flow {
        emit(homeApi.getSimpleType())
    }.flowOn(Dispatchers.IO)

    fun getSimpleVideoByChannelId(channelId: String,page: Int,pageSize: Int) = flow {
        emit(homeApi.getSimpleVideoByChannelId(channelId,page,pageSize))
    }.flowOn(Dispatchers.IO)

}